using System.Collections;
using System.Collections.Generic;
using UnityEngine;

/// <summary>
/// 冰冻Buff数据
/// </summary>
[CreateAssetMenu(menuName = "创建ScriptableObject/BuffData/Freeze")]
public class FreezeData : BuffData
{
    [Header("冰冻效果设置")]
    [Tooltip("速度倍率（0.0-1.0）")]
    [Range(0.0f, 1.0f)]
    public float SpeedMultiplier = 0.0f;
    
    [Tooltip("是否影响攻击速度")]
    public bool AffectAttackSpeed = true;
    
    [Tooltip("攻击速度倍率")]
    [Range(0.0f, 1.0f)]
    public float AttackSpeedMultiplier = 0.0f;
    
    [Tooltip("冰冻伤害")]
    public long Damage = 0;
    
    [Tooltip("是否可以被净化")]
    public bool CanBeCleansed = true;
    
    [Tooltip("是否可以被免疫")]
    public bool CanBeImmune = true;

    private void OnValidate()
    {
        // 确保BuffType正确设置
        if (BuffType != BuffType.Freeze)
        {
            BuffType = BuffType.Freeze;
        }
        
        // 设置默认标签
        if (Tags == BuffTag.None)
        {
            Tags = BuffTag.Control | BuffTag.Slow;
        }
    }
}